# 定义users应用的路由信息
from django.conf.urls import url

from . import views

# 在urlpatterns 中定义当前应用的所有路由
urlpatterns = [
    # url(r'^路径$', views.视图),
    # http://127.0.0.1:8000/users/index/
    # 如果url匹配r'^index/$'成功, 就调用views.index视图
    # url(r'^index/$', views.index),

    # 测试只在子路由里面把视图的所有路由定义出来
    url(r'^users/index/$', views.index, name='reverse_demo'),

    # 演示路由匹配顺序: 路由的匹配是自上而下的
    # http://127.0.0.1:8000/users/say
    # http://127.0.0.1:8000/users/sayhello
    # url(r'^users/say', views.say),
    # url(r'^users/sayhello', views.say_hello),

    # 注意点: 定义路由时一定要有开始和结束
    url(r'^users/say/$', views.say),
    url(r'^users/sayhello/$', views.say_hello),

    # 建议在路由的最后加上斜线
]


